package com.jd.dao;

import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.jd.po.User;
import com.jd.po.UserGroup;

public class UserGroupDAOImpl extends HibernateDaoSupport implements UserGroupDAO {
	@Override
	public String getLoginAddr(User user,String tOrb) {
		List list=null;
		list = this.getHibernateTemplate().find("select userGroup from UserGroup userGroup where userGroup.gname = '" + user.getUserGroup() + "'");
		if(list.size() == 0) {
			return null;
		} else {
			if(tOrb.equals("t")){
				return ((UserGroup)list.get(0)).getTrunk_login();
			}else {
				return ((UserGroup)list.get(0)).getBranch_login();
			}
			
		}
		
	}

	@Override
	public String getGroups(User user) {
		// TODO Auto-generated method stub
		return null;
	}


}
